
trigger: none

schedules:
- cron: "0 11 * * 1,3"
  displayName: Every Monday and Wednesday at 3:00 AM (UTC-8:00)
  branches:
    include:
    - main
  always: true

pr:
  branches:
    include:
    - main
    - release/*.*
  paths:
    include:
    - '*'
    exclude:
    - /**/*.md
    - eng/Version.Details.xml
    - .devcontainer/*
    - .github/*
    - docs/*
    - LICENSE.TXT
    - PATENTS.TXT
    - THIRD-PARTY-NOTICES.TXT

variables:
  - template: /eng/pipelines/common/variables.yml

extends:
  template:  /eng/pipelines/common/templates/pipeline-with-resources.yml
  parameters:
    stages:
    - stage: Build
      jobs:

      #
      # Build CoreCLR and Libraries
      #
      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/global-build-job.yml
          buildConfig: checked
          platforms:
          - windows_x64
          jobParameters:
            buildArgs: -s clr+libs -c $(_BuildConfig) -lc Release
            postBuildSteps:
              - template: /eng/pipelines/coreclr/templates/build-native-test-assets-step.yml
              - template: /eng/pipelines/common/upload-artifact-step.yml
                parameters:
                  rootFolder: $(Build.SourcesDirectory)/artifacts/bin
                  includeRootFolder: false
                  archiveType: $(archiveType)
                  archiveExtension: $(archiveExtension)
                  tarCompression: $(tarCompression)
                  artifactName: BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)
                  displayName: Build Assets
            extraVariablesTemplates:
              - template: /eng/pipelines/common/templates/runtimes/native-test-assets-variables.yml
                parameters:
                  testGroup: innerloop

      #
      # CoreCLR Test build
      #
      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml
          buildConfig: checked
          platforms:
          - CoreClrTestBuildHost # Either osx_x64 or linux_x64
          jobParameters:
            testGroup: innerloop

      #
      # CoreCLR Test executions using live libraries
      #

      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
          buildConfig: checked
          platforms:
          - windows_x64
          helixQueueGroup: cet
          helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
          jobParameters:
            testGroup: innerloop
            liveLibrariesBuildConfig: release
            useCodeFlowEnforcement: true
            unifiedArtifactsName: BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)
